package com.crm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.dao.ConsultInfoManagePayMapper;
import com.crm.model.ConsultInfoManagePay;
import com.crm.model.entity.ConsultInfoManagePayEntity;
import com.crm.service.ConsultInfoManagePayService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@Service
public class ConsultInfoManagePayServiceImpl extends BaseServiceImpl<ConsultInfoManagePay> implements ConsultInfoManagePayService{
	@Autowired
	private ConsultInfoManagePayMapper consultInfoManagePayMapper;
	@Override
	public List<ConsultInfoManagePayEntity> selectPayDetail(Page<ConsultInfoManagePayEntity> page,
			ConsultInfoManagePayEntity consultInfoManagePayEntity) {
		PageHelper.startPage(page.getPageNum(), page.getPageSize(), "cimp.create_date desc");
		return consultInfoManagePayMapper.selectPayDetail(consultInfoManagePayEntity);
	}

	@Override
	public List<Map<String, Object>> selectKindOfPayCount(ConsultInfoManagePayEntity consultInfoManagePayEntity) {
		return consultInfoManagePayMapper.selectKindOfPayCount(consultInfoManagePayEntity);
	}

	@Override
	public List<ConsultInfoManagePay> getPayDetailByInfoId(String infoManageId) {
		return consultInfoManagePayMapper.getPayDetailByInfoId(infoManageId);
	}
	
	@Override
	public ConsultInfoManagePay getPaySumByInfoId(String infoManageId) {
		return consultInfoManagePayMapper.getPaySumByInfoId(infoManageId);
	}
}
